#pragma once
#include "const.h"
#include"LogicSystem.h"
#include"CSession.h"
class LogicSystem;
class CSession;

class MsgNode
{
public:
	MsgNode(short max_len);

	~MsgNode();

	void Clear();

	short _cur_len;
	short _total_len;
	char* _data;
};


class RecvNode :public MsgNode {
	friend class LogicSystem;
public:
	RecvNode(short max_len, short msg_id);

	short _msg_id;
};

class SendNode :public MsgNode {
	friend class LogicSystem;
public:
	SendNode(const char* msg, short max_len, short msg_id);
	short _msg_id;
};


class LogicNode {
	friend class LogicSystem;
public:
	LogicNode(std::shared_ptr<CSession> s, std::shared_ptr<RecvNode> recv);
private:
	std::shared_ptr<CSession> _session;
	std::shared_ptr<RecvNode> _recv;
};